package javabasics.designpattern.singleton;

/**
 * 内部类实现懒加载单例模式
 * @Author suxiaoxiao
 * @Date 2019/5/30 23:11
 * @Version 1.0
 */
public class StaticSingleton {

    private StaticSingleton() {
        System.out.println("StaticSingleton is create");
    }

    private static class SingletonHolder {
        private static StaticSingleton instance = new StaticSingleton();
    }

    public static StaticSingleton getInstance() {
        return SingletonHolder.instance;
    }

}
